package demo;


class Base {
    public int a = 1;
    public int b;

    public void methodA() {
        System.out.println("base-methodA");
    }

}
class Derived extends Base{
    public int a = 10;
    public int c;
    public void method() {
        System.out.println(a); //10
        System.out.println(super.a);//1
        System.out.println(b);
    }
    public void methodA(char ch){//方法的重载
        System.out.println("subclass-methodA");
    }
    public void test() {
        methodA('e');
        super.methodA();
    }
}
public class Test2 {
    public static void main(String[] args) {
        Derived derived = new Derived();
        //derived.method();
        //System.out.println(derived.a);
        derived.test();
    }
}
